class Group < ActiveRecord::Base
  validates :name, :presence => true, :uniqueness => true
  has_many :group_permissions
  has_many :permissions, :through => :group_permissions
  has_many :news_groups
  has_many :news

  has_many :clue_groups
  has_many :clues


  def platform_name
    case name
      when '管理员'
        '新闻网'
      when '校报组'
        '校报'
      when  '外宣组'
        '外宣'
    end
  end
end
